import time

from Page.Page import Page
from selenium.webdriver.common.by import By
class Page1(Page):
    # 点击商品
    shop_loc=(By.XPATH,'//*[@id="crazySale"]/div[1]/div[2]/div[1]/ul/li[1]/div[1]/a/img')
    # 选择数量
    num_loc=(By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[6]/div[4]/div[2]/div[1]/a[1]')
    # 点击加入购物车
    gwc_loc=(By.ID,'addToCartForDetail')

    gwclook_loc = (By.NAME, 'detail_chakangouwuche')
    # 点击去结算
    js_loc = (By.CLASS_NAME, 'done')
    # 点击提交订单
    content_loc = (By.ID, 'submitOrder')
    #点击查看购物车
    def shop(self):
        self.click(self.shop_loc)
    def num(self):
        self.click(self.num_loc)
    def gwc(self):
        self.click(self.gwc_loc)
    def lookgwc(self):
        self.click(self.gwclook_loc)
    def js(self):
        self.click(self.js_loc)
    def context(self):
        self.click(self.content_loc)

    def jiuxian_luoji2(self):
        self.jiuxian_luoji1()
        time.sleep(5)
        self.shop()
        self.content_page()
        self.num()
        self.gwc()
        self.content_page()
        self.lookgwc()
        self.content_page()
        self.js()
        self.content_page()
        self.scroll(200)
        self.context()




